1. Field of the Invention
The present invention relates generally to image processing apparatuses, image processing methods, programs, and storage media. More particularly, the present invention relates to a technique suitably used in detection of moirés caused by halftone processing.
2. Description of the Related Art
In these days, image data processed by personal computers (PCs) is often printed. However, the number of gray levels available to printers or displays to represent the image data of each pixel can be less than that available to the PCs. Accordingly, before the image data is output to the printers or the displays, halftone processing for converting image data of more gray levels into image data of less gray levels is often performed on the image data.
However, the halftone processing can cause moirés and, ultimately, deterioration of image quality. An ordered dithering method is one type of the available halftone processing. In the ordered dithering method, an output value is decided based on comparison of cyclically repeated thresholds with each pixel value. In an input image having a special frequency component close to that of the thresholds, the ordered dithering method causes a moiré corresponding to a difference between the spatial frequencies. An error diffusion method is also available as another type of the halftone processing. It is known that the error diffusion method causes a moiré of a repeated characteristic pattern in an output image of a flat input image having given color density.
As one of techniques for detecting occurrence of such a moiré, Japanese Patent Laid-Open No. 9-238259 has proposed a moiré detection method based on a difference between input image data and image data resulting from halftone processing. More specifically, in this method, difference data between the input image data and the image data resulting from the halftone processing is determined. Bandpass filtering processing is then performed on the difference data. In this way, a moiré component is extracted.
Another moiré detection method, such as one disclosed in Japanese Patent Laid-Open No. 2001-86355, is also available that performs visual-characteristic-based filtering processing on image data resulting from halftone processing to detect occurrence of a moiré. More specifically, in this method, input image data is phase-shifted by a half phase. The visual-characteristic-based filtering processing is performed on input image data having undergone the halftone processing and the phase-shifted image data having undergone the halftone processing. A difference between the filtering results is evaluated.
When input image data includes a frequency component close to that of a moiré component, determining whether the frequency component is the moiré component resulting from the halftone processing or is originally included in the input image data is difficult in the foregoing methods according to the related art. A printed image of image data having undergone the halftone processing may be copied or may be scanned with a scanner, processed, and then printed. In such cases, since resolution of the data input by copiers and scanners deteriorates, accurately detecting a moiré is also difficult in the foregoing methods according to the related art. Accordingly, in the related art, pattern detection is performed to detect dots and smoothing processing is performed on the dot-detected parts before the halftone processing.
Additionally, in the method using the visual characteristic-based filtering processing, the filtering processing is changed in accordance with resolution of output devices.